﻿using MediatR;
using Warehouse.Domain;
using Warehouse.Infrstructre.Interface;
using Warehouse.Read.API.Applcation.Command.AllocateCommand;
using Warehouse.Read.API.Applcation.Command.InjureCommand;

namespace Warehouse.Read.API.Applcation.CommandHandlers.AllocateCommandHandlers
{
    public class AllocateFanCommandHandlers : IRequestHandler<AllocateFanCommand, Allocate>
    {
        private readonly IAllocateRepository _allocateRepository;
        public AllocateFanCommandHandlers(IAllocateRepository _allocateRepository)
        {
            this._allocateRepository = _allocateRepository;
        }
        public async Task<Allocate> Handle(AllocateFanCommand request, CancellationToken cancellationToken)
        {
            return await _allocateRepository.GetModelAsync(request.AllocateId);
        }
    }
}
